//
// Created by heqian on 17-8-11.
//

#include "BoardInfo.h"

namespace mahjong {
    UserBoard::UserBoard() :
            mLackBoard(M_NONE),
            mIsDealer(false) {
        mBoard = new vector<MahjongEnum>();
        mOpen = new vector<MahjongEnum>();
        mOut = new vector<MahjongEnum>();
    }

    void UserBoard::clear() {
        mLackBoard = M_NONE;
        mIsDealer = false;
        mBoard->clear();
        mOpen->clear();
        mOut->clear();
    }

    Prt<vector<MahjongEnum>> &UserBoard::getBoard() {
        return mBoard;
    }

    Prt<vector<MahjongEnum>> &UserBoard::getOut() {
        return mOut;
    }

    Prt<vector<MahjongEnum>> &UserBoard::getOpen() {
        return mOpen;
    }

    bool UserBoard::isDealer() const {
        return mIsDealer;
    }

    void UserBoard::setIsDealer(bool mIsDealer) {
        UserBoard::mIsDealer = mIsDealer;
    }

    MahjongEnum UserBoard::getLackBoard() const {
        return mLackBoard;
    }

    void UserBoard::setLackBoard(MahjongEnum mLackBoard) {
        UserBoard::mLackBoard = mLackBoard;
    }

/////////////////////////////////////////////////////////////////////////////////////////////////////

    BoardInfo::BoardInfo() {
        mMe = new UserBoard();
        mTop = new UserBoard();
        mUp = new UserBoard();
        mDown = new UserBoard();
    }

    void BoardInfo::clear() {
        mMe->clear();
        mTop->clear();
        mUp->clear();
        mDown->clear();
    }

    Prt<UserBoard> &BoardInfo::getMe() {
        return mMe;
    }

    Prt<UserBoard> &BoardInfo::getUp() {
        return mUp;
    }

    Prt<UserBoard> &BoardInfo::getDown() {
        return mDown;
    }

    Prt<UserBoard> &BoardInfo::getTop() {
        return mTop;
    }
}
